package com.spring.boot.demo.config;

import com.spring.boot.demo.interceptor.FirstInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ZhuYouBin
 * @version 1.0.0
 * @Date: 2022/10/25 22:40
 * @Description
 */
//@Configuration
public class WebMvcConfig02 implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册拦截器
        registry.addInterceptor(new FirstInterceptor())
                .addPathPatterns("/**"); // TODO 拦截所有请求路径，拦截路径自定义
    }
}
